package com.ruoyi.web.core.config;

import com.github.wxpay.sdk.WXPayConfig;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

/**
 * @description:
 * @author: LinChuan
 * @date: 2022/2/19 13:17
 **/
@Slf4j
public class YdcxConfig extends WechatConfig {
    /**
     * 天蛙小程序appId
     */
    public static final String APPID = "wxe29f58902775ce8d";

    /**
     * 天蛙小程序密钥
     */
    public static final String SECRET = "5951f721d928c5e31afce3273226134f";

    /**
     * 有电创新商户号
     */
    public static final String MCHID = "1508382801";

    /**
     * 有电创新商户密钥 --- 同 API V3 密钥
     */
    public static final String KEY = "Qwertyuioplkjhgfdsazxcvbnm369873";

    /**
     * 有电创新 API V3 秘钥  未设置
     */
    public static final String API_V3_KEY = "";


    public static final String BODY = "智能物联";

    public static final  String DESC = "智能物联分润到账";

    /**
     * 有电创新商户支付分充电宝服务号 未开通
     */
    public static final String SERVICE_ID = "";

    /**
     * 支付分签名方式
     */
    public static final String SIGN_TYPE = "HMAC-SHA256";

    /**
     * 金额环回说明
     */
    public static final String REFUND_DESC = "智能物联，余额退还";

    /**
     * 有电创新新商户api证书序列号
     * https://myssl.com/cert_decode.html 证书解析地址
     */
    public static final String SERIAL_NO = "3786106784817C51DE475E1C7CDB75BEBB4E5061";

    /**
     * 有电创新新证书内容  apiclient_key.pem文件中的内容 除去开头结尾行
     *  请求量大为节约资源直接拿出来
     */
    public static final String PRIVATE_CONTENT = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDdUHPcM/Hig65D" +
            "CH7sQ9sv3bPxFaKpNrS9IJ5VAu6eMNhvhZe3wcE3RwLj+D7kNIFRZE84dDD3qAPL" +
            "Nc9X9ktFueM5Ydjpsa7dbP4iOWr2VB16sU4zcT10zBOIpRNshT/mX1qeCvghqv5m" +
            "xYJh8+W5gcQyGEmLNzMK3hrP6WGSchS9hrBZ2NMHRD3xiQ3XsGgnSIoMo1YZl1PE" +
            "kJbS8/BPEWhyRf+1Pn6n4y2t9HTTA/+6ovfVZ2MhmfFwCO3S1CW9FM7GSZLVxfgP" +
            "o6Ali8Kc16DpGMzdKHbkRqOxa6mvgX4sD9rlFnGwyMCQM5hs0fUlwJYac0Hf6NfF" +
            "WNbvrojBAgMBAAECggEASz3T9hRu8wzDzSRxSlATj+V3DMrHP3JK5lXVnp9dksiW" +
            "fOvVVfL4hpuM3waCE0HKiWpqCI5wK3Kiv46uzH/+vVjiaJrcjS8MfVlV2TreI5sb" +
            "XqAzLwgb1b6gEX/V57oxrFfUzhB6pa+lyDj0B+tMudHlawaY0kzU/KfgQ7lbo9al" +
            "NNGGLXxWvHmJoaJbMTEvK7Ewv+I1fSSRWHx4wK2XfIBAaxcqmt4dNAX/KfwWL0ty" +
            "9WPyjvshuucnKhJC1kmKpXriGg8R6q4YI0NTJ9zwTO3CRZaD1Vjy/yXbeKtaZmBy" +
            "lOO0rUZ5w0hQFSN1LtM8W9KLk9phvyiKkeOcCRcdsQKBgQD5Cf6zou2uNeu5dmKg" +
            "JEn+QQ0sQ7w4X8gfQq/p7ga/SAQFS/k1fs7qkvnx9d0JpdWWztgKlbx1QofhVixH" +
            "814/EcazDY5VXrodA4wK1bCXUJt36J+ekwwr5Zh1svxxv3ag/GNebyXv7zCWlnjM" +
            "zJ/oQNcY9zHi+tuzJDCWTFpfTQKBgQDjgBKEdtLUSgp9hyJIY0F1e3dfGvBoLKis" +
            "wcjyUwEol9X8Pqa2CVelD86wrAwoKinqHLGL+n4H9sCCRUyaj5GmM2HIhqhf2zZt" +
            "P5hAJhceusyAd+A2/RwSGODdXYBiGJ0vRo7KXzkHYheFqEvtsG/ftHMy3ULYkEE0" +
            "pB6XMVO9RQKBgQCSxDgt58RJWg+88i73j8tnozC/OIARfSk0exmvNI8XZbqw4HBS" +
            "/ZO2HL5ewXXtvKTexrH9svco5/eqbh2UnbGaW8CNP1z1pOjsNm3u6La0xlWJWjfP" +
            "vXt710h9fOlXo+2mvHdXbQuflog9BxrUH3fR6XyagvwMd6jIr3hO61qLNQKBgEgl" +
            "5bl8tX/9uzX0FTs/vxKzBTh0Iqnm/9dJ3aB8EnH9NS+57sTsUY9XZAVDitdyB7jn" +
            "QKdT2YRNDOBDeffKcDZ1NR2TFvLPYoNjF7XAXrSwKQrU+ZZ2zuAuY6HQdVam17KW" +
            "fdJQQJXG1g7dQLcwrUoUwDPxV7G2jfdT1R+91QDBAoGAVfwZYjudNSAw82WG7f05" +
            "gOiwa+NIHDVKwTs2/9bj5rShgIMa1F4aC0vKDSsXr6ibEccF9paaFHmmIOw5leke" +
            "XfGtbYK5AcLeSDDAtTTFVRSPQ7mbmEInbi5thtz3LD1tuu1K4sZe0SFCKk2Dws1q" +
            "6Jq2c7/DWfbf99PFrN3+SHo=";

    @Override
    public String getAppid() {
        return APPID;
    }

    @Override
    public String getSecret() {
        return SECRET;
    }

    @Override
    public String getMchId() {
        return MCHID;
    }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getApiV3Key() {
        return API_V3_KEY;
    }

    @Override
    public String getBody() {
        return BODY;
    }

    @Override
    public String getDesc() {
        return DESC;
    }

    @Override
    public String getServiceId() {
        return SERVICE_ID;
    }

    @Override
    public String getSignType() {
        return SIGN_TYPE;
    }

    @Override
    public String getRefundDesc() {
        return REFUND_DESC;
    }

    @Override
    public String getSerialNo() {
        return SERIAL_NO;
    }

    @Override
    public String getPrivateContent() {
        return PRIVATE_CONTENT;
    }

    @Override
    public WXPayConfig getWXPayConfig() {
        try {
            return new YdcxPayConfig();
        } catch (IOException e) {
            log.error("【error】：有电创新商户配置文件初始化失败" +e.getMessage(), e);
        }
        return null;
    }
}
